package com.lagou.app;

import com.lagou.dao.PhoneDao;
import com.lagou.entity.Phone;
import org.junit.Test;

import java.sql.SQLException;
import java.util.List;

public class TestPhone {
    /**
     *  查询价格高于2000元，生产日期是2019年之前的所有手机
     */
    PhoneDao dao = new PhoneDao();
    @Test
    public void test1() throws SQLException {
        List<Phone> phone = dao.findPhone("2000", "2019-01-01");
        for (Phone phone1 : phone) {
            System.out.println(phone1);
        }
    }
    /**
     * 查询所有颜色是白色的手机信息
     */
    @Test
    public void test2() throws SQLException {
        Phone phone = dao.findPhoneByColor("白色");
        System.out.println(phone);
    }
}
